basedir = '/Users/Alex/Documents/Dev/Ecplise_Workspace/QuasiSpecies/Debug/';
popsize = 2;
headsize = 3;
fig1 = figure('name','Different initial ratios');
xlabel('t');
ylabel('frequency');
hold on;
title('Vir Population');
ColOrd = get(gca,'ColorOrder');
[m,n] = size(ColOrd);
colorCnt = 1;
for ratio=.95:.55:.96,
    ['running and plotting for ratio: ', num2str(ratio)]
    cmdstr = getcmdstr(0.036,0.0046,ratio,30000)
    cmd = [basedir,cmdstr];
    unix(cmd)
    [head,out] = readData('out.dat',headsize,4);
    x = linspace(0,max(out(:,1)),max(out(:,1))+1);
    y = linspace(0,max(out(:,2)),max(out(:,2))+1);
    tmp = strtrim(head(end));
    tmp = textscan(tmp{1}, '%u');
    M = tmp{1};
    Nstr = head(11);
    [start_idx, end_idx] = regexp(Nstr{1},'[0-9]{1,10}');
    N = str2double(Nstr{1}(start_idx:end_idx));
    z = reshape(out(:,3),size(y,2),size(x,2));
    for j=2:size(M,1)
        ColRow = rem(colorCnt,m);
        if ColRow == 0
            ColRow = m;
        end
        % Get the color
        Col = ColOrd(ColRow,:);
        newy = z(M(j)+1,:)/N;
        plot(x,newy,'DisplayName',['Gene ',num2str(M(j)), ' ratio: ', num2str(ratio)],'Color',Col);
        colorCnt = colorCnt+1;
    end
end
legend('show');